package cron

import (
	"context"
	"github.com/robfig/cron/v3"
	"time"
)

type Task struct {
	instance *cron.Cron
	jobs     []Job // 记录所有注册的job
	//locker   locker.Client //需要分布式锁
	// ctx*用于shutdown
	ctx           context.Context
	ctxCancelFunc context.CancelFunc
	ctxTimeout    time.Duration
}

type TaskInterface interface {
	Add(spec string, task func())
	Start()
	Stop()
}

type taskOption func(*Task)

func NewTask(opt ...taskOption) *Task {

}
